function imgHashToSrc(hash){
    //  xxxxxxxxxxxjpeg
    //  x/xx/xxxxxxjpeg.jpeg

    let arr = hash.split("");

    arr.splice(1,0,"/");
    arr.splice(4,0,"/");
    let src = arr.join("");

    src = "https://fuss10.elemecdn.com/"+src;

    if(hash.endsWith("jpeg")){
        src+=".jpeg"
    }else if(hash.endsWith("png")){
        src+=".png"
    }else if(hash.endsWith("jpg")){
        src+=".jpg"
    }

    return src;
}


function mToKm(value){
    if(value<1000){
        return value+"m";
    }
    return (value/1000).toFixed(2)+"km";
}


export {imgHashToSrc,mToKm}